using System;
using Microsoft.Xna.Framework;

namespace SolarWinds.Input
{
    public class MouseEvent : InputEvent
    {
        private readonly Point mAbsPos;
        private readonly Point mRelPos;
        private readonly int mAbsWheelPos;
        private readonly int mRelWheelPos;
        private readonly MouseButtons mButton;

        #region Properties

        public Point AbsolutePosition
        {
            get { return mAbsPos; }
        }

        public Point RelativePosition
        {
            get { return mRelPos; }
        }
        public int AbsoluteWheelPosition
        {
            get { return mAbsWheelPos; }
        }

        public int RelativeWheelPosition
        {
            get { return mRelWheelPos; }
        }

        public MouseButtons Button
        {
            get { return mButton; }
        }

        #endregion

        public MouseEvent(TimeSpan time, InputModifiers modifiers, 
                          Point absPosition, Point relPosition, 
                          int absWheelPos, int relWheelPos,
                          MouseButtons button)
            : base(time, modifiers)
        {
            mAbsPos = absPosition;
            mRelPos = relPosition;
            mAbsWheelPos = absWheelPos;
            mRelWheelPos = relWheelPos;
            mButton = button;
        }

        public override string ToString()
        {
            return base.ToString() + "{Button:" + mButton +
                   " AbsPos:" + mAbsPos + 
                   " RelPos:"+mRelPos +
                   " AbsWheelPos:" + mAbsWheelPos +
                   " RelWheelPos:" + mRelWheelPos + "}";
        }
    }
}